/**
 * \file  plugin_admin.h
 * \brief Definition and Implementation of PluginAdmin class.
 *
 * ASO: Antiviral Sequence Optimizer
 * <http://aso.googlecode.com/>
 * Copyright (C) 2010 Velez Ezequiel, Peralta Andres, FuDePAN
 *
 * This file is part of the ASO project.
 *
 * Contents:       Header file for ASO providing class PluginAdmin.
 *
 * System:         ASO
 * Language:       C++
 *
 * Author:         Velez Ezequiel, Peralta Andres
 * E-Mail:
 *
 * ASO is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * ASO is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with ASO.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef PLUGIN_ADMIN_H
#define PLUGIN_ADMIN_H

#include <mili/mili.h>
#include "aso-core/plugin.h"

typedef std::string FileName;

/* Definición de la Clase PluginAdmin */
class PluginAdmin
{
private:
    Plugin* plg;

public:
    /*! Constructor */
    PluginAdmin()
        : plg(NULL)
    {}

    /*! Obtener el menor puntaje del score. */
    inline Score get_min_score() const
    {
        return plg->get_min_scoring_value();
    }

    /*! Obtener la lista de parámetros del plugin. */
    inline void get_params(ParameterList& params) const
    {
        plg->get_params(params);
    }

    /*! Obtener la política de Generación del plugin. */
    inline GenerationPolicy* get_generation_policy() const
    {
        return plg->get_generation_policy();
    }

    /*! Obtener la validación de la combinación. */
    inline bool validate_combination(const AntiviralSet& antivirals) const
    {
        return plg->validate_combination(antivirals);
    }

    /*! Crear un nodo de terapia. */
    inline TherapyNode* create_node(const biopp::PseudoNucSequence& sequence, TherapyNode* parent, const AntiviralSet& av, DistanceValue value, const size_t id) const
    {
        return plg->create_node(sequence, parent, av, value, id);
    }

    /*! Obtener la matriz de distancia del plugin. */
    inline void get_distance_matrix(biopp::DistanceMatrix& matrix) const
    {
        set_default_matrix(matrix);
        plg->get_distance_matrix(matrix);
    }

    /*! Cargar un Plugin */
    void load_plugin(const FileName& file) throw(PluginError);

    /*! Obtener el nombre del plugin */
    inline const std::string& get_name() const
    {
        return plg->get_name();
    }

    /*! Descargar el plugin actual. */
    void unload_plugin();
    /*! Chequea la consistencia de la base de datos.  */
    bool check_plugin(AVIterator aIt, AntiviralsNames& rejectedAntivirals);
};

#endif
